/**
 * 
 */
package design_pattern.visitor.pc;

import java.util.Vector;

/**
 * @author linzq
 * 
 */
public class InventoryVisitor extends Visitor {

  private Vector inv;

  public InventoryVisitor() {
    inv = new Vector(10, 5);
  }

  public int size() {
    return inv.size();
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitHardDisk(visitor.pc.HardDisk)
   */
  @Override
  public void visitHardDisk(HardDisk e) {
    inv.addElement(e);
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitPC(visitor.pc.PC)
   */
  @Override
  public void visitPC(PC e) {
    inv.addElement(e);
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitMainBoard(visitor.pc.MainBoard)
   */
  @Override
  public void visitMainBoard(MainBoard e) {
    inv.addElement(e);
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitCase(visitor.pc.Case)
   */
  @Override
  public void visitCase(Case e) {
    inv.addElement(e);
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitCPU(visitor.pc.CPU)
   */
  @Override
  public void visitCPU(CPU e) {
    inv.addElement(e);
  }

  /*
   * (non-Javadoc)
   * 
   * @see visitor.pc.Visitor#visitIntegratedBoard(visitor.pc.IntegratedBoard)
   */
  @Override
  public void visitIntegratedBoard(IntegratedBoard e) {
    inv.addElement(e);
  }

}
